package com.metroinfo.infrastructure;

import java.util.concurrent.ConcurrentHashMap;

import com.metroinfo.infrastructure.keys.BusLineDataKey;
import com.metroinfo.infrastructure.value.BusLineValue;
import com.metroinfo.interfaces.DataStructInterface;

public class BusLineData implements DataStructInterface{

	ConcurrentHashMap<BusLineDataKey, BusLineValue> busLineData = new ConcurrentHashMap<BusLineDataKey, BusLineValue>();
	
	public BusLineData (int i, int k)
	{
		for(int g=1; g< i; g++)
		{
			BusLineDataKey busLineKey = new BusLineDataKey(Integer.valueOf(g));
			busLineData.put(busLineKey, new BusLineValue( g%k ));
		}
	}

	@Override
	public Object getValue(Object o) {
		return busLineData.get((BusLineDataKey)o);
	}

	@Override
	public boolean isExists(Object o) {
		return busLineData.containsKey((BusLineDataKey)o);
	}

	@Override
	public boolean refresh() {
		return true;
	}
	
}
